package com.asset.dispoal.business.casedispose.service.command;

import com.asset.dispoal.business.casedispose.domain.db.mapper.CasedisposeMapper;
import com.asset.dispoal.business.casedispose.dto.CaseDisposalFileResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tech.mhuang.pacebox.core.ddd.BaseCommand;
import tech.mhuang.pacebox.springboot.protocol.Result;

import java.util.List;

@Component
public class CaseDisposalFileGetCaseIdCommand implements BaseCommand<String, Result<List<CaseDisposalFileResponse>>> {

    @Autowired
    CasedisposeMapper casedisposeMapper;

    @Override
    public Result<List<CaseDisposalFileResponse>> execute(String caseId) {
        return Result.ok(casedisposeMapper.queryFileByCaseId(caseId));
    }
}
